<template>
    <div class="newDiscItems">
        <div class="newDiscItems-top">
            <img :src="src" alt="">
            <a class="newDiscItems-content-back"></a>
            <a class="playIcon" href="javascript:;" @click="getSingId(id)"></a>
        </div>
        <div class="newDiscItems-bottom">
            <div class="sing-title">
                <a href="" :title="name">{{ name }}</a>
            </div>
            <div class="sing-author">
                <a href="" :title="author">{{ author }}</a>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import playerStore from '@/store/modules/player';
defineProps({
    src: String,
    name: String,
    author: String,
    id: Number,
    alId: Number
})
let playerUseStore = playerStore()
const getSingId = async (id: number) => {
    await playerUseStore.getSingAl(id)
}
</script>

<style scoped lang="less">
.newDiscItems {
    width: 118px;
    height: 150px;
    background: url(../../assets/images/index.png) no-repeat;
    background-position: -260px 100px;
    position: relative;
    box-sizing: border-box;

    .newDiscItems-top {
        width: 100px;
        height: 100px;
        position: relative;
        margin-bottom: 7px;

        &:hover {
            .playIcon {
                display: block;
            }
        }

        img {
            width: 100%;
            height: 100%;
        }

        .newDiscItems-content-back {
            width: 118px;
            height: 100px;
            position: absolute;
            top: 0;
            left: 0;
            background: url(../../assets/images/coverall.png);
            background-position: 0 -570px;
        }

        .playIcon {
            display: none;
            position: absolute;
            background-image: url(../../assets/images/iconall.png);
            right: 10px;
            bottom: 5px;
            width: 22px;
            height: 22px;
            background-position: 0 -85px;
        }
    }

    .newDiscItems-bottom {
        .sing-title {
            width: 90%;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-wrap: normal;

            a {
                color: #000;
                font-size: 12px;

                &:hover {
                    text-decoration: underline;
                }
            }
        }

        .sing-author {
            width: 90%;
            line-height: 18px;

            a {
                color: #666;
                font-size: 12px;

                &:hover {
                    text-decoration: underline;
                }
            }
        }
    }
}</style>